from django.db import models

from django.conf import settings


# Create your models here.
def upload_to(instance, filename):
    s = '/'.join(['documents/', 'doc.md'])
    print(instance)
    return s


class Tag(models.Model):
    tagName = models.CharField('tag name', max_length=10)
    tagWeight = models.IntegerField(default=0)
    isDefault = models.BooleanField(default=False)


class Document(models.Model):
    docName = models.CharField('document name', max_length=20)
    docFile = models.FileField(upload_to=upload_to)
    tags = models.ManyToManyField(Tag)

    def __str__(self):
        return self.docName
